import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class EntertainMenuMIDlet extends MIDlet implements CommandListener {

	List menuScreen;
	Command quitCmd = new Command("Quit", Command.EXIT, 10);
	Display display;

	public EntertainMenuMIDlet() {
		super();
        //#style mainScreen
		this.menuScreen = new List("Entertainment App", List.IMPLICIT);
        //#style mainCommand
		this.menuScreen.append("Start", null);
        //#style mainCommand
		this.menuScreen.append("Settings", null);
        //#style mainCommand
		this.menuScreen.append("Help", null);
		//#style mainCommand
		this.menuScreen.append("Quit", null);
		this.menuScreen.setCommandListener(this);
		this.menuScreen.addCommand(this.quitCmd);
	}

	protected void startApp() throws MIDletStateChangeException {
		this.display = Display.getDisplay(this);
		this.display.setCurrent(this.menuScreen);
	}

	protected void pauseApp() {
		// ignore
	}

	protected void destroyApp(boolean unconditional)
			throws MIDletStateChangeException {
		// just quit
	}

	public void commandAction(Command cmd, Displayable screen) {

		if (cmd == List.SELECT_COMMAND) {
			int selectedItem = this.menuScreen.getSelectedIndex();
			switch (selectedItem) {
			case 0:
				startApplication();
				break;
			case 1:
				showSettings();
				break;
			case 2:
				showHelp();
				break;
			default:
				notifyDestroyed();
			}
		} else if (cmd == this.quitCmd) {
			quit();
		}
	}

	private void startApplication() {

	}

	private void showSettings() {

	}

	private void showHelp() {

	}

	private void quit() {
		notifyDestroyed();
	}

}
